﻿namespace TestNewGuiFramework
{
    using Pps.Gui.Controls;

    internal class OverviewWindow : BaseWindow
    {
        private Label state;
        private Label indoorTemperature;
        private Label outdoorTemperature;
        private Label forwardTemperature;

        public OverviewWindow()
        {
            this.InitializeControls();
        }

        protected override void InitializeControls()
        {
            base.InitializeControls();

            this.state = new Label("Status: Manuell", 280, 50);

            this.indoorTemperature = new Label("Innentemperatur: 22.0 °C", 280, 120);

            this.outdoorTemperature = new Label("Außentemperatur: 12.0 °C", 280, 190);
            this.forwardTemperature = new Label("Vorlauftemperatur: 34.5 °C", 280, 260);

            this.overview.Selected = true;
            this.overview.Enabled = false;

            this.AddControlsToWindow();
        }

        protected override void AddControlsToWindow()
        {
            base.AddControlsToWindow();

            this.AddChildControl(this.state);
            this.AddChildControl(this.indoorTemperature);
            this.AddChildControl(this.outdoorTemperature);
            this.AddChildControl(this.forwardTemperature);
        }

        protected override void Update()
        {
            System.Random test = new System.Random();

            this.indoorTemperature.Text = "Innentemperatur: " + test.Next(100).ToString("F1") + " °C";
            this.outdoorTemperature.Text = "Außentemperatur: " + test.Next(100).ToString("F1") + " °C";
            this.forwardTemperature.Text = "Vorlauftemperatur: " + test.Next(100).ToString("F1") + " °C";
        }
    }
}